<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>用户文件列表页面</title>
    <link href="../resources/favicon.ico" rel="shortcut icon" th:href="@{/static/favicon.ico}"/>
    <script th:src="@{/js/jquery.js}"></script>
</head>
<body>

<hr>

<h3>上传文件:</h3>

<form enctype="multipart/form-data" method="post" th:action="@{/upload}">
    <input name="multipartFile" type="file">
    <input type="submit" value="上传文件">
</form>

<hr>

<table border="10px">
    <tr>
        <th>ID</th>
        <th>文件原始名称</th>
        <th>文件的新名称</th>
        <th>文件后缀</th>
        <th>存储路径</th>
        <th>文件大小</th>
        <th>类型</th>
        <th>是否是图片</th>
        <th>下载次数</th>
        <th>上传时间</th>
        <th>操作</th>
    </tr>
    <tr th:each="file,fileStat:${file}">
        <td><span th:text="${file.id}"/></td>
        <td><span th:text="${file.oldFileName}"/></td>
        <td><span th:text="${file.newFileName}"/></td>
        <td><span th:text="${file.ext}"/></td>
        <td><span th:text="${file.path}"/></td>
        <td><span th:text="${file.size}"/></td>
        <td><span th:text="${file.type}"/></td>
        <td>
            <img alt="" style="width: 100px;height: 40px;"
                 th:if="${file.isImg}=='是'"
                 th:src="${#servletContext.contextPath}+${file.path}+'/'+${file.newFileName}">
            <span th:if="${file.isImg}!='是'" th:text="${file.isImg}"/>
        </td>
        <td th:id="${file.id}"><span th:text="${file.downcounts}"/></td>
        <td><span th:text="${#dates.format(file.uploadTime,'yyyy-MM-dd HH:mm:ss')}"/></td>
        <td>
            <a th:href="@{/download(id=${file.id})}">下载</a>
            <a th:href="@{/download(id=${file.id},openStyle='inline')}">在线打开</a>
            <a th:href="@{/file/delete(id=${file.id})}">删除</a>
        </td>
    </tr>
</table>

<div id="Visualize">p</div>

<iframe src="222.html">

</iframe>
</body>
</html>
